package com.ruoyi.system.domain;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 员工信息对象 epm_information
 * 
 * @author ruoyi
 */
public class EpmInformation extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自动id号 */
    private Long id;

    /** userid号 */
    private Long userId;

    /** 员工名称 */
    @Excel(name = "员工名称")
    private String name;

    /** 部门ID */
    @Excel(name = "部门编号")
    private Long deptId;


    /** 工号 */
    @Excel(name = "工号")
    private String empNumber;

    /** 岗位(导入用) */
    @Excel(name = "岗位Id",type = Excel.Type.IMPORT)
    private String postId;

    /** 用户性别（0男 1女 2未知） */
    @Excel(name = "用户性别(男，女)", readConverterExp = "0=男,1=女,2=未知")
    private String sex;

    /** 身份证 */
    @Excel(name = "身份证")
    private String idCard;

    /** 身份证号地域 */
    @Excel(name = "身份证号地域")
    private String idNumberRegion;

    /** 手机号码 */
    @Excel(name = "手机号码")
    private String phoneNumber;

    /** 地域 */
    @Excel(name = "地域",dictType="region",comboReadDict=true)
    private String region;

    /** 合同签订时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "合同签订时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date contractDate;

    /** 合同截至日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "合同截至日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date contractLong;

    /** 入职时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "入职时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date date;

    @Excel(name = "社保缴纳情况")
    private String typeOfEmployment;

    /** 人员类型(0在岗职工，1劳务派遣人员，2其他从业人员) */
    @Excel(name = "人员类型(在岗职工，劳务派遣人员，其他从业人员)", readConverterExp = "0=在岗职工,1=劳务派遣人员,2=其他从业人员")
    private String typeOfMen;

    /** 婚姻状态（0未婚,1已婚） */
    @Excel(name = "婚姻状态(未婚/已婚)", readConverterExp = "0=未婚,1=已婚")
    private String maritalStatus;

    /** 政治面貌 */
    @Excel(name = "政治面貌")
    private String politicalLandscape;

    /** 住址 */
    @Excel(name = "住址")
    private String address;

    /** 最高学历 */
    @Excel(name = "最高学历",dictType="education",comboReadDict=true)
    private String highEducationalLevel;

    /** 毕业学校 */
    @Excel(name = "毕业学校")
    private String school;

    /** 学制类型 */
    @Excel(name = "学制类型")
    private String typeEducation;

    /** 专业 */
    @Excel(name = "专业")
    private String major;

    /** 民族 */
    @Excel(name = "民族")
    private String nation;

    /** 紧急联系人 */
    @Excel(name = "紧急联系人")
    private String emergencyContact;

    /** 紧急联系人电话 */
    @Excel(name = "紧急联系人电话")
    private String emergencyContactPhone;

    /** 第一学历 */
    private String firstDegree;

    /** 第二学历 */
    private String secondDegree;



    /** 开户行 */
    @Excel(name = "开户行")
    private String bank;

    /** 银行账号 */
    @Excel(name = "银行账号")
    private String bankAccountNumber;

    /** 爱好特长 */
    @Excel(name = "爱好特长")
    private String hobby;

    /** 是否安排寝室 */
    @Excel(name = "是否安排寝室")
    private String dormitoryNeed;

    /** 寝室号 */
    @Excel(name = "寝室号")
    private String dormitory;

    /** 出生年月 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出生年月", width = 30, dateFormat = "yyyy-MM-dd")
    private Date birthday;

    /** 其他 */
    @Excel(name = "其他")
    private String other;

    /** 预留字段1 */
    @Excel(name = "预留字段1")
    private String Reserved1;

    /** 预留字段2 */
    @Excel(name = "预留字段2")
    private String Reserved2;

    /** 预留字段3 */
    @Excel(name = "预留字段3")
    private String Reserved3;

    /** 预留字段4 */
    @Excel(name = "预留字段4")
    private String Reserved4;

    /** 预留字段5 */
    @Excel(name = "预留字段5")
    private String Reserved5;

    /** 预留字段6 */
    @Excel(name = "预留字段6")
    private String Reserved6;

    /** 预留字段7 */
    @Excel(name = "预留字段7")
    private String Reserved7;

    /** 预留字段8 */
    @Excel(name = "预留字段8")
    private String Reserved8;

    /** 部门对象 */
    @Excels({
            @Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT),
            @Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT)
    })
    private SysDept dept;



    /** 岗位组 */
    private Long[] postIds;

    public String getPostId() {
        return postId;
    }

    public void setPostId(String postId) {
        this.postId = postId;

        if (postId == null || postId.isEmpty()) {
            this.postIds = new Long[0];
            return;
        }

        String[] parts = postId.split(",");
        List<Long> idList = new ArrayList<>();

        for (String part : parts) {
            try {
                idList.add(Long.parseLong(part.trim()));
            } catch (NumberFormatException e) {
                // 处理无效数值，例如抛出异常或记录错误
                throw new IllegalArgumentException("无效的岗位ID格式: " + part);
            }
        }

        this.postIds = idList.toArray(new Long[0]);
    }

    /** 角色对象 */
    private List<SysRole> roles;

    /** 角色组 */
    private Long[] roleIds;




    /** 是否在职 */
    private int employed_or_not;

    public int getEmployed_or_not() {
        return employed_or_not;
    }

    public void setEmployed_or_not(int employed_or_not) {
        this.employed_or_not = employed_or_not;
    }


    public List<SysRole> getRoles() {
        return roles;
    }

    public void setRoles(List<SysRole> roles) {
        this.roles = roles;
    }

    public Long[] getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(Long[] roleIds) {
        this.roleIds = roleIds;
    }

    public Long[] getPostIds() {
        if (postIds != null && postIds.length == 0) {
            return null;
        }
        return postIds;
    }

    public void setPostIds(Long[] postIds) {
        this.postIds = postIds;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    /** 角色ID */
    private Long roleId;

    public SysDept getDept()
    {
        return dept;
    }

    public String getDeptName() {
        if (dept != null) {
            return dept.getDeptName();
        }
      return null;
    }
    public void setDept(SysDept dept)
    {
        this.dept = dept;
    }


    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    public void setEmpNumber(String empNumber)
    {
        this.empNumber = empNumber;
    }

    public String getEmpNumber() 
    {
        return empNumber;
    }
    public void setSex(String sex)
    {
        this.sex = sex;
    }

    public String getSex() 
    {
        return sex;
    }
    public void setIdCard(String idCard)
    {
        this.idCard = idCard;
    }

    public String getIdCard() 
    {
        return idCard;
    }
    public void setIdNumberRegion(String idNumberRegion)
    {
        this.idNumberRegion = idNumberRegion;
    }

    public String getIdNumberRegion() 
    {
        return idNumberRegion;
    }
    public void setPhoneNumber(String phoneNumber)
    {
        this.phoneNumber = phoneNumber;
    }

    public String getPhoneNumber() 
    {
        return phoneNumber;
    }
    public void setRegion(String region)
    {
        this.region = region;
    }

    public String getRegion() 
    {
        return region;
    }
    public void setContractDate(Date contractDate)
    {
        this.contractDate = contractDate;
    }

    public Date getContractDate() 
    {
        return contractDate;
    }
    public void setContractLong(Date contractLong)
    {
        this.contractLong = contractLong;
    }

    public Date getContractLong() 
    {
        return contractLong;
    }
    public void setDate(Date date)
    {
        this.date = date;
    }

    public Date getDate() 
    {
        return date;
    }
    public void setTypeOfEmployment(String typeOfEmployment)
    {
        this.typeOfEmployment = typeOfEmployment;
    }

    public String getTypeOfEmployment() 
    {
        return typeOfEmployment;
    }
    public void setTypeOfMen(String typeOfMen)
    {
        this.typeOfMen = typeOfMen;
    }

    public String getTypeOfMen() 
    {
        return typeOfMen;
    }
    public void setMaritalStatus(String maritalStatus)
    {
        this.maritalStatus = maritalStatus;
    }

    public Long getDeptId()
    {
        return deptId;
    }

    public void setDeptId(Long deptId)
    {
        this.deptId = deptId;
    }


    public String getMaritalStatus() 
    {
        return maritalStatus;
    }
    public void setPoliticalLandscape(String politicalLandscape)
    {
        this.politicalLandscape = politicalLandscape;
    }

    public String getPoliticalLandscape() 
    {
        return politicalLandscape;
    }
    public void setAddress(String address)
    {
        this.address = address;
    }

    public String getAddress() 
    {
        return address;
    }
    public void setHighEducationalLevel(String highEducationalLevel)
    {
        this.highEducationalLevel = highEducationalLevel;
    }

    public String getHighEducationalLevel() 
    {
        return highEducationalLevel;
    }
    public void setSchool(String school)
    {
        this.school = school;
    }

    public String getSchool()
    {
        return school;
    }
    public void setMajor(String major)
    {
        this.major = major;
    }

    public String getMajor()
    {
        return major;
    }
    public void setNation(String nation)
    {
        this.nation = nation;
    }

    public String getNation()
    {
        return nation;
    }
    public void setEmergencyContact(String emergencyContact)
    {
        this.emergencyContact = emergencyContact;
    }

    public String getEmergencyContact()
    {
        return emergencyContact;
    }
    public void setEmergencyContactPhone(String emergencyContactPhone)
    {
        this.emergencyContactPhone = emergencyContactPhone;
    }

    public String getEmergencyContactPhone() 
    {
        return emergencyContactPhone;
    }
    public void setFirstDegree(String firstDegree)
    {
        this.firstDegree = firstDegree;
    }

    public String getFirstDegree() 
    {
        return firstDegree;
    }
    public void setSecondDegree(String secondDegree)
    {
        this.secondDegree = secondDegree;
    }

    public String getSecondDegree() 
    {
        return secondDegree;
    }
    public void setTypeEducation(String typeEducation)
    {
        this.typeEducation = typeEducation;
    }

    public String getTypeEducation() 
    {
        return typeEducation;
    }
    public void setBank(String bank)
    {
        this.bank = bank;
    }

    public String getBank() 
    {
        return bank;
    }
    public void setBankAccountNumber(String bankAccountNumber)
    {
        this.bankAccountNumber = bankAccountNumber;
    }

    public String getBankAccountNumber() 
    {
        return bankAccountNumber;
    }
    public void setHobby(String hobby)
    {
        this.hobby = hobby;
    }

    public String getHobby() 
    {
        return hobby;
    }
    public void setDormitoryNeed(String dormitoryNeed)
    {
        this.dormitoryNeed = dormitoryNeed;
    }

    public String getDormitoryNeed() 
    {
        return dormitoryNeed;
    }
    public void setDormitory(String dormitory)
    {
        this.dormitory = dormitory;
    }

    public String getDormitory()
    {
        return dormitory;
    }
    public void setBirthday(Date birthday)
    {
        this.birthday = birthday;
    }

    public Date getBirthday() 
    {
        return birthday;
    }
    public void setOther(String other)
    {
        this.other = other;
    }

    public String getOther() 
    {
        return other;
    }
    public void setReserved1(String Reserved1)
    {
        this.Reserved1 = Reserved1;
    }

    public String getReserved1() 
    {
        return Reserved1;
    }
    public void setReserved2(String Reserved2)
    {
        this.Reserved2 = Reserved2;
    }

    public String getReserved2() 
    {
        return Reserved2;
    }
    public void setReserved3(String Reserved3)
    {
        this.Reserved3 = Reserved3;
    }

    public String getReserved3() 
    {
        return Reserved3;
    }
    public void setReserved4(String Reserved4)
    {
        this.Reserved4 = Reserved4;
    }

    public String getReserved4() 
    {
        return Reserved4;
    }
    public void setReserved5(String Reserved5)
    {
        this.Reserved5 = Reserved5;
    }

    public String getReserved5() 
    {
        return Reserved5;
    }
    public void setReserved6(String Reserved6)
    {
        this.Reserved6 = Reserved6;
    }

    public String getReserved6() 
    {
        return Reserved6;
    }
    public void setReserved7(String Reserved7)
    {
        this.Reserved7 = Reserved7;
    }

    public String getReserved7() 
    {
        return Reserved7;
    }
    public void setReserved8(String Reserved8)
    {
        this.Reserved8 = Reserved8;
    }

    public String getReserved8() 
    {
        return Reserved8;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("name", getName())
            .append("deptId",getDeptId())
            .append("empNumber", getEmpNumber())
            .append("sex", getSex())
            .append("idCard", getIdCard())
            .append("idNumberRegion", getIdNumberRegion())
            .append("phoneNumber", getPhoneNumber())
            .append("region", getRegion())
            .append("contractDate", getContractDate())
            .append("contractLong", getContractLong())
            .append("date", getDate())
            .append("typeOfEmployment", getTypeOfEmployment())
            .append("typeOfMen", getTypeOfMen())
            .append("maritalStatus", getMaritalStatus())
            .append("politicalLandscape", getPoliticalLandscape())
            .append("address", getAddress())
            .append("highEducationalLevel", getHighEducationalLevel())
            .append("school", getSchool())
            .append("major", getMajor())
            .append("nation", getNation())
            .append("emergencyContact", getEmergencyContact())
            .append("emergencyContactPhone", getEmergencyContactPhone())
            .append("firstDegree", getFirstDegree())
            .append("secondDegree", getSecondDegree())
            .append("typeEducation", getTypeEducation())
            .append("bank", getBank())
            .append("bankAccountNumber", getBankAccountNumber())
            .append("hobby", getHobby())
            .append("dormitoryNeed", getDormitoryNeed())
            .append("dormitory", getDormitory())
            .append("birthday", getBirthday())
            .append("other", getOther())
            .append("Reserved1", getReserved1())
            .append("Reserved2", getReserved2())
            .append("Reserved3", getReserved3())
            .append("Reserved4", getReserved4())
            .append("Reserved5", getReserved5())
            .append("Reserved6", getReserved6())
            .append("Reserved7", getReserved7())
            .append("Reserved8", getReserved8())
            .append("dept", getDept())
            .append("postIds",getPostIds())
            .append("postId",getPostId())
            .toString();
    }
}
